﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Segmentator.Dividers
{
    /// <summary>
    /// Генерирует случайное значение порога в заданных пределах
    /// </summary>
    class RandomThreshold:ThresholdVariator
    {
        public static readonly string Name = "Случайный выбор порога в заданных пределах";
        private Random Value;
        public RandomThreshold(double leftBound, double rightBound)
            : base(leftBound, rightBound)
        {
            Value = new Random(DateTime.Now.Millisecond);

        }

        public override double next(double dist)
        {
            Threshold = Value.Next((int)LeftBound, (int)RightBound);
            return Threshold;
        }
    }
}
